package com.maoyu.cloud.spring.util;

import org.springframework.util.DigestUtils;

public class MD5Util {
    private MD5Util() {

    }

    private final static String passwdKey = "abc123456abc";

    public String encode(CharSequence rawPassword) {
        if (rawPassword == null) {
            throw new IllegalArgumentException("rawPassword cannot be null");
        }
        String rst = DigestUtils.md5DigestAsHex((rawPassword + passwdKey).getBytes());
        return rst;
    }
}
